<?php

namespace App\Models\ModelManage;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Icon
 * @package App\Models\ModelManage
 * @version August 11, 2018, 2:50 pm CST
 *
 * @property \App\Models\ModelManage\Iconcat iconcat
 * @property string name
 * @property integer iconcat_id
 * @property string icon
 * @property string highlight
 * @property string selected
 */
class Icon extends Model
{
    use SoftDeletes;


    public $table = 'icons';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'name',
        'iconcat_id',
        'icon',
        'highlight',
        'selected'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'name' => 'string',
        'iconcat_id' => 'integer',
        'icon' => 'string',
        'highlight' => 'string',
        'selected' => 'string'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        'name' => 'required|max:100'
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function iconcat()
    {
        return $this->hasOne(\ App\Models\ModelManage\Iconcat::class, 'id', 'iconcat_id');
    }
}
